assigning the value of “expr” to the variable;
or:
put the position into <x,y>
assigning the current pen coordinates to the variables x,y.
The forward command takes the form:
forward <distance>
The distance parameter represents pixels. Fractional values are significant. This is the only drawing command; it draws a straight line (unless the pen is up).
The “turn right” command takes the form:
turn right <angle>
The angle parameter represents degrees. Values outside the range ±359 are rendered modulo 360 (so that, e.g., 370 becomes 10).
“Turn left” is the same as “turn right”, except it turns the other way.
The “set heading” command takes the form:
set heading <angle>
The parameter represents degrees. The constants “north,” “east,” “south,” & “west,” can be used as equivalents for 0, 90, 180, & 270 respectively.
The “set position” command takes the form:
set position <x,y>
The parameters represent horizontal & vertical pixel coordinates. The center of the window is 0,0, so that the “x” coordinate is negative left of center, “y” negative below the center.
The penSize command takes 2 parameters, representing the width and height in pixels of the line drawn by the pen:
penSize <width,height>.
The parameters must be greater than zero, less than the width & height of the screen.
The penMode command takes one of 9 constant parameters: normal, patXor, blend, addPin, addOver, subPin, subOver, adMax, adMin.
All but the first 2 modes work only in color.
The penPat command takes an integer parameter in the range 1..40. It causes the pen to draw using the corresponding pattern (as shown in the “Edit Patterns” dialog).
The “foreColor” command sets the drawing color. It takes an integer parameter which represents the index value of the color (in the range 0..255) in the current palette. In a black-&-white environment, “foreColor” does nothing.
The “backColor” command sets the background color, i.e., the color that appears when the window is erased. Its parameter, like that of “foreColor,” represents an index to the current palette. Also like “foreColor,” it has no effect in black-&-white.
The “pen up” command causes all drawing to cease until “pen down” is called.
The “pen down” command causes drawing to resume after a preceding “pen up” command.
The “clear screen” command erases whatever has been drawn in the window.
The wrap command takes either of two parameters, “on” or “off”.
“Wrap on” causes drawing that goes off one edge of the window to wrap around and continue in from the opposite edge.
“Wrap off” disables wrapping.
The openPoly command causes all subsequent lines drawn to be grouped in a polygon, until “closePoly” is called. It also has the effect of “pen up,” so call “pen down” if you want the outline to be visible.
The closePoly command concludes the recording of a polygon begun with “openPoly.” It also restores the pen to its state prior to calling “openPoly”; i.e., it has the effect of “pen down.”
The offSetPoly command takes two parameters, representing horizontal and vertical pixel distances. It moves the most recently recorded polygon (if any) by that distance.
The paintPoly command fills in the most recently recorded polygon using the current pen color, mode, and pattern.
The fillPoly command fills in the most recently recorded polygon with the pattern indicated by its single integer parameter (in the range 1..40, as shown in the “Display Patterns” dialog).